import http from '../utils/axios';


// export const api:string = 'http://1.14.123.156:8080'   /////云端地址
 //1.14.123.156 
export const api:string = 'http://dsq.ljc.icu:8080'    /////本地Ip地址
 //172.16.110.80
export const classifiedData = () => {
    return http.get<any>(api + '/shopping/category/getParentList')
}

// 获取二级菜单
export const secondarYmenu = (data:any) => http.get( api + '/shopping/category/getList',data)

// 获取下拉框里面的分类内容
export const downBox = () =>{
    return http.get<any>(api + '/shopping/category/findAll')
}


// 添加商品分类
export const addgoods = (data:any) => {
    return http.post<any>(api + '/shopping/category/updateCate',data)
}

// 这是删除这个二级分类
export const deletesecondary = (params:any) =>{
    return http.get<any>(api + '/shopping/category/deleteCateId',params)
}


// 获取商品评价的全部数据
export const classification = (data:any)=>{
    return http.post<any>(api + '/shopping/appraise/findByAppraise',data)
}


// 按照评分进行排序
export const appraise = (data:any) =>{
    return http.post<any>(api + '/shopping/appraise/findByAppraise',data)
}

// 全查类别 
export const check = () =>{
    return http.get<any>(api + '/shopping/category/findAll')
}

// 商品分类单独删除和数组删除
export const del = (data:any) =>{
    return http.post<any>(api + '/shopping/appraise/delByAppraiseId',data)
}

// 上传图片
export const goodsImg = (data:any) =>{
    return http.post<any>(api + '/shopping/upload/upload',data)
}

// 回复用户的评论
export const reply = (data:any)=>{
    return http.post<any>(api + '/shopping/appraise/updateAppraise',data)
}